<%@ page language="java" pageEncoding="UTF-8"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html:html lang="true">
<head>
	<html:base />

	<title>user_list.jsp</title>

	<meta http-equiv="pragma" content="no-cache" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta http-equiv="expires" content="0" />
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
	<meta http-equiv="description" content="This is my page" />
	<script type="text/javascript" src="<%=request.getContextPath()%>/js/base.js"></script>
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/base_orange.css" />
</head>

<body>
	<html:form action="/user">
		<table class="title1">
			<tr>
				<td class="title1_td1">
					用户管理
				</td>
				<td class="title1_td2">
					<input class="button_2zi" type="button" value="添 加"
						onclick="disableParamsStartWith('userName',0);dosubmit(this.form, '../user.do?method=insertUser');" />
					<input class="button_2zi" type="button" value="修 改"
						onclick="disableParam('userName',0);dosubmit(this.form, '../user.do?method=updateUser', 'update');" />
					<input class="button_2zi" type="button" value="删 除"
						onclick="disableParam('userName',0);dosubmit(this.form, '../user.do?method=deleteUsers', 'delete');" />
					<input class="button_4zi" type="button" value="重置密码" onclick="" />
					<input class="button_4zi" type="button" value="分配角色"
						onclick="disableParam('userName',0);dosubmit(this.form, '../user.do?method=updateUserRole', 'update');" />
					<input class="button_2zi" type="button" value="启 用"
						onclick="disableParam('userName',0);dosubmit(this.form, '../user.do?method=enableUsers', 'atLeastOne');" />
					<input class="button_2zi" type="button" value="禁 用"
						onclick="disableParam('userName',0);dosubmit(this.form, '../user.do?method=disableUsers', 'atLeastOne');" />
				</td>
			</tr>
		</table>
		<table class="table1">
			<tr>
				<td class="td100">
					用户名
					<html:text property="userName" value="${userForm.userName}" size="15"></html:text>
					&nbsp;&nbsp;&nbsp;&nbsp;
					真实姓名
					<html:text property="realName" size="15"></html:text>
					&nbsp;
					<input type="submit" class="button_2zi" value="查 询"
						onclick="disableParamsStartWith('userName',1);appendUrl('?method=getUsersByPage&searchFlag=1');" />
				</td>
			</tr>
		</table>
		<table class="table2">
			<tr>
				<th>
					<input type="checkbox" onclick="selectAll('userName',this.checked)" />
				</th>
				<th>
					用户名
				</th>
				<th>
					真实姓名
				</th>
				<th>
					性别
				</th>
				<th>
					状态
				</th>
			</tr>
			<logic:iterate id="userForm" name="userFormList">
				<tr onclick="selectCheckbox(this)">
					<td>
						<html:checkbox property="userName" value="${userForm.userName}" onclick="this.checked=!this.checked" />
					</td>
					<td>
						${userForm.userName}
					</td>
					<td>
						${userForm.realName}
					</td>
					<td>
						<!-- Integer转String -->
						<c:set var="sex">${userForm.sex}</c:set>
						${sexMap[sex]}
					</td>
					<td>
						<c:set var="enabled">${userForm.enabled}</c:set>
						${enableMap[enabled]}
					</td>
				</tr>
			</logic:iterate>
		</table>
		<jsp:include page="/admin/core/page_info/page_info.jsp"></jsp:include>
	</html:form>
</body>
</html:html>
